div#image_assign_filter_and_image_sizing {
  width: 100%;
  height: 40px;
}

#picture_archive {

  .selected_item_tools {
    margin: -2*$default-padding;
    border-bottom: 1px solid $default-border-color;
    margin-bottom: 4*$default-padding;
    padding: 4*$default-padding;
    display: none;
  }
}

.picture_thumbnail {
  padding: $default-padding;
  margin: 2px 1px 2px 2px;
  background-color: #fff;
  float: none;
  display: inline-block;
  border: 1px solid #c0c0c0;
  position: relative;
  @extend %rounded-border;

  img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
  }

  .thumbnail_background {
    @extend %thumbnail-background;
    width: 160px;
    height: 120px;
  }

  .picture_name {
    height: 14px;
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    position: absolute;
    bottom: 1px;
    left: 0;
    font-family: "Courier New", Courier, mono;
    line-height: 11px;
    padding: 2px 0;
    margin-right: 4px;
    margin-left: 4px;
  }

  &.small {
    width: 80px;
    height: 80px;

    .picture_name {
      width: 80px;
    }

    .thumbnail_background {
      width: 80px;
      height: 60px;
    }
  }

  &.medium {
    width: 160px;
    height: 140px;

    .picture_name {
      width: 160px;
    }

    .thumbnail_background {
      width: 160px;
      height: 120px;
    }
  }

  &.large {
    width: 240px;
    height: 200px;

    .picture_name {
      width: 240px;
    }

    .thumbnail_background {
      width: 240px;
      height: 180px;
    }
  }

  &:hover {

    .picture_tool {
      display: block;
    }
  }
}

#pictures {
  margin-right: 232px;
  padding-bottom: 60px;

  .picture_thumbnail {
    margin: 0 8px 8px 0;
    display: inline-block;
    float: none;

    .thumbnail_background {
      @include zoom-in;
    }
  }
}

div.assign_image_list_image {
  text-align: center;
  overflow: hidden;
  position: relative;

  img {
    border-style: none;
  }
}

.picture_tool {
  width: 16px;
  height: 16px;
  position: absolute;
  background-color: white;
  top: 3px;
  padding: 1px;
  z-index: 10;
  display: none;

  &.visible {
    display: block;
  }

  &.hidden {
    display: none;
  }

  &.select {
    left: 4px;

    input {
      margin: 0;
      padding: 0;
    }
  }

  &.delete {
    right: 4px;

    a {
      background: image-url('alchemy/icons.png') no-repeat -63px -72px;
    }
  }

  a {
    display: block;
    width: 16px;
    height: 16px;
    cursor: pointer;
  }
}

div#library_sidebar {
  box-sizing: border-box;
  position: fixed;
  border-left: 1px solid $default-border-color;
  top: 0;
  right: 0;
  width: 232px;
  padding-top: 96px;
  padding: 84px 4*$default-padding 0 4*$default-padding;
  height: 100%;
  z-index: 3;
  background-color: $light-gray;

  h2 {
    margin-top: 4*$default-margin;
  }
}

.alchemy-dialog #library_sidebar {
  position: absolute;
}

div#filter_bar {

  .selectboxit {
    width: 194px;
  }
}

.tag-list {
  box-sizing: border-box;
  height: 100%;
  padding-bottom: 138px;

  &.filtered {
    padding-bottom: 164px;
  }

  &.with_filter_bar {
    padding-bottom: 218px;

    &.filtered {
      padding-bottom: 244px;
    }
  }

  .js_filter_field_box {
    position: absolute;
    right: auto;
    top: auto;
    width: 200px;
    z-index: 1100;

    input {
      width: 200px;
      background-color: #f8f8f8;
    }

    label { display: none }
  }

  .js_filter_field_clear {
    right: 4px;
  }

  ul {
    box-sizing: border-box;
    list-style-type: none;
    padding: 0;
    margin: 40px 0 4px 0;
    height: 100%;
    width: 200px;
    overflow-x: hidden;
    overflow-y: auto;

    li {
      @include tag-base;
      display: block;

      &:first-child { margin-top: 0 }

      a {
        text-decoration: none;
        display: block;
      }

      &:hover { background-color: $very-light-blue }

      &.active {
        background-color: $dark-gray;

        a, &:before { color: $light-gray }
      }
    }
  }
}

.alchemy-dialog-body {

  #library_sidebar {
    padding: 0 4*$default-padding;
  }
}

#assign_image_list, #assign_file_list {
  position: relative;
  height: 519px;
}

#assign_image_list {
  padding-right: 244px;

  .tag-list ul {
    height: 316px;
  }

  &.filtered .tag-list ul {
    height: 292px;
  }
}

#assign_file_list {

  .tag-list ul {
    height: 396px;
  }

  &.filtered .tag-list ul {
    height: 372px;
  }
}

#overlay_file_list {

  &.with_tag_list {
    padding-right: 234px;
  }

  .assign_file_file {
    display: block;
    margin-bottom: 4px;
    word-break: break-all;

    &:hover {
      background-color: $light_yellow;
    }
  }

  > ul {
    margin: 0;
    padding: 4px 0;

    a {
      @extend %text-overflow;
      display: block;
      line-height: 25px;
      text-decoration: none;
      padding: 0px 4px 2px 4px;
    }

    .icon {
      margin-top: -2px;
      margin-right: 4px;
    }
  }
}

.picture_tags {
  box-sizing: border-box;
  width: 50%;
  max-height: 100%;
  position: absolute;
  top: 16px;
  left: 0;
  padding: $default-padding;
  pointer-events: none;
  display: none;
}

.picture_thumbnail:hover .picture_tags {
  display: block;
}

.tag {
  display: inline-block;
  vertical-align: middle;
  @extend %rounded-border;
  padding: $default-padding 2*$default-padding $default-padding 4*$default-padding;
  margin: $default-margin/2 0;
  background-color: rgba($medium-gray, 0.85);
  color: $text-color;
  overflow: hidden;
  position: relative;
  pointer-events: none;
  font-size: 10px;

  &:before {
    position: absolute;
    left: $default-padding;
    top: 2*$default-padding;
    font-family: 'Alchemy Icons';
    @extend .icon-tag:before;
    line-height: 6px;
  }
}

.tags .list .tag {
  padding: 0;
}
